package com.data.sample.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.data.sample.entity.CkMapping;
import com.data.sample.entity.EquipmentUnit;
import com.data.sample.entity.OpcUaPoint;
import com.data.sample.mapper.EquipmentUnitMapper;
import com.data.sample.mapper.OpcUaCkMapper;
import com.data.sample.service.IOpcUaCkMappingService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * OPC UA点位 Service实现
 * @author zhaocx
 * @date 2025-10-24
 */
@Slf4j
@Service
public class OpcUaCkMappingServiceImpl extends ServiceImpl<OpcUaCkMapper, CkMapping> implements IOpcUaCkMappingService {

    @Autowired
    OpcUaCkMapper opcUaCkMapper;

    @Override
    public List<CkMapping> selectStorage(String protocolId) {

        List<CkMapping> ckStorageLst = opcUaCkMapper.selectByProtocolId(protocolId);
        return ckStorageLst;
    }


    @Override
    public void dynamicBatchInsert(
            String tableName,
            List<String> columns,
            List<Map<String, Object>> dataList){
        opcUaCkMapper.dynamicBatchInsert(tableName, columns, dataList);
    }
}

